package com.hivekion.quartz.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hivekion.common.entity.PagedResultVo;
import com.hivekion.quartz.domain.JobEntity;
import com.hivekion.quartz.domain.vo.*;
import org.quartz.Job;

import java.util.List;
import java.util.Map;

public interface IQuartzService extends IService<JobEntity> {

    /**
     * 查询已启动的任务列表
     */
    List<JobRunViewVo> queryListOpen();

    List<JobRunViewVo> queryRuningList();

    Boolean addJob(JobCreateInputVo job);

    void addJob(Class<? extends Job> jobClass, String cronExp, Map<String, Object> data, String jobName);

    Boolean updateJob(JobUpdateInputVo job);

    /*
     * 启动定时任务
     * */
    boolean startJob(String id);

    /**
     * 执行Job
     */
    Boolean runJob(String id);

    Boolean runJob(JobCreateInputVo job);

    /**
     * 暂停Job
     */
    Boolean pauseJob(String id);

    /**
     * 唤醒Job
     */
    Boolean resumeJob(String id);

    /**
     * 删除Job
     */
    Boolean deleteJob(String id);

    void deleteJob2(String jobName);

    Boolean removes(List<String> ids);

    PagedResultVo<JobViewVo> queryList(JobSearchPageVo jobEntity);

    JobModelVo getInfo(String id);
}
